# 需要开启这个参数，https://github.com/jemalloc/jemalloc/issues/1328
ROCKETMQ_HOME=${DEFAULT_ROCKETMQ_HOME:-'/opt/software/rocketmq'}
mkdir -p ${ROCKETMQ_HOME}

# 拉取镜像信息
docker pull registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apache_rocketmq:5.3.0
docker tag registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apache_rocketmq:5.3.0 apache/rocketmq:5.3.0
docker rmi registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apache_rocketmq:5.3.0
docker pull registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apacherocketmq_rocketmq-dashboard:latest
docker tag registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apacherocketmq_rocketmq-dashboard:latest apacherocketmq/rocketmq-dashboard:latest
docker rmi registry.cn-hangzhou.aliyuncs.com/mrzhou1553/apacherocketmq_rocketmq-dashboard:latest


docker network create rocketmq

docker run -itd --name rmq-namesrv -p 9876:9876 --network rocketmq apache/rocketmq:5.3.0 sh mqnamesrv

echo "brokerIP1=61.172.179.46" > ${ROCKETMQ_HOME}/broker.conf
docker stop rmq-broker && docker rm rmq-broker
chmod 777 -R ${ROCKETMQ_HOME}
docker run -itd --name rmq-broker --network rocketmq -e "NAMESRV_ADDR=61.172.179.46:9876" \
  -p 10912:10912 -p 10911:10911 -p 10909:10909 -p 8080:8080 -p 8081:8081 \
  -v ${ROCKETMQ_HOME}/broker-data:/home/rocketmq/store \
  -v ${ROCKETMQ_HOME}/broker-logs:/home/rocketmq/logs \
  -v ${ROCKETMQ_HOME}/broker.conf:/home/rocketmq/rocketmq-5.3.0/conf/broker.conf \
  -v ${ROCKETMQ_HOME}/plain_acl.yml:/home/rocketmq/rocketmq-5.3.0/conf/plain_acl.yml \
  apache/rocketmq:5.3.0 sh mqbroker --enable-proxy -c /home/rocketmq/rocketmq-5.3.0/conf/broker.conf



docker stop rmq-dashboard && docker rm rmq-dashboard
docker run -itd --name rmq-dashboard --network rocketmq -v ${ROCKETMQ_HOME}/dashboard-config:/config -e "JAVA_OPTS=-Drocketmq.namesrv.addr=61.172.179.46:9876" -p 28080:8080 -t apacherocketmq/rocketmq-dashboard:latest

验证
docker logs -f rmq-namesrv
docker exec -it rmq-broker bash -c "tail -n 10 /home/rocketmq/logs/rocketmqlogs/proxy.log"
docker logs -f rmq-dashboard
